<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html> <!--<![endif]-->

<#include "../common/assignparam.ftl"  />
<@header deep="3"/>
<body class="body">

<!-- 头部 -->
<#assign currentChannel="userspace"/>
<#include "../common/header.ftl"  />  

<div class="mra_t_15">
    <div id="content-container" class="container">
        <a href="learn.html" class=" hidden" data-toggle="modal"  class="hidden">
        	<span class="receive-modal"></span>
        </a>
        <div class="es-section login-section" style="margin-top: 100px;"> 
            <div class="logon-tab clearfix">
                <a class="active">登录帐号</a>
               <!-- <a href="${contextPath}/user/open/regist/toRegist" >注册帐号</a>-->
            </div>
            <div class="login-main">
                <form id="login-form" class="form-vertical" method="post" action="${contextPath}/login" onsubmit="return loginValidation()" >
                    <div class="form-group mbl">
                        <label class="control-label" for="login_username">帐号</label>
                        <div class="controls">
                            <input class="form-control input-lg" id="login_username" type="text" name="username" value="" required placeholder='邮箱/手机/用户名'/>
                            <div class="help-block"></div>
                        </div>
                    </div>
                    <div class="form-group mbl">
                        <label class="control-label" for="login_password">密码</label>
                        <div class="controls">
                            <input class="form-control input-lg" id="login_password" type="password" name="password" required placeholder='密码' autocomplete='off'/>
                        </div>
                    </div>
                    <div class="form-group mbl">
	                    <input class="form-control input-lg" type="text" id="PverificationCodeId" name="PverificationCode" value="" placeholder="验证码" style="width:105px;display: inline-block">
	                    <img src="${contextPath}/portal/captcha/generateCaptcha.do?num=0" id="PverificationImg" >
	                    <a href="javascript:void(0);" id="PverificationCode"><span>看不清，换一张</span></a>
	                </div>
                    <div class="form-group mbl">
                        <div class="controls">
<!--                             <input type="checkbox" name="_remember_me" checked="checked"> 记住密码 -->
							<#if error=="true">
							<span class="text-danger" id="userCheck">用户名或密码错误</span>
							</#if>
							<span class="text-danger" id="verificationCode" style="display:none;">验证码错误</span>
                        </div>
                    </div>
                    <div class="form-group mbl">
                        <button type="submit" class="btn btn-primary4 btn-lg btn-block">登录</button>
                    </div>
                    <input type="hidden" name="hash"/>
                </form>
                <div class="social-login">
        			<span>         
						      <a href="http://weibo.com/u/5980037952?refer_flag=1001030101_&amp;is_hot=1#_loginLayer_1469943377816" target="_blank"  class="social-icon social-weibo">
						          <i class="es-icon es-icon-weibo"></i>
						      </a>						  
						      <a class="social-icon social-weixin" id="login-weixin">
						          <i class="es-icon es-icon-weixin"></i>
						          <div class="erweima">
						            <img src="http://mat1.gtimg.com/bj2022/winter-olympic-2022/dongaoweixin.jpg" alt="">
						         </div>
						      </a>
        				</span>
                    <div class="line"></div>
                </div>
            </div>
        </div>
    </div>
</div>	
<!--底部-->

<@portalFooter deep="3"/>
  
<div id="login-modal" class="modal" data-url="/login/ajax"></div>
<div id="modal" class="modal"></div>
<script src="${contextPath}/common/jquery-md5/jQuery.md5.js" type="text/javascript"></script> 
<script type="text/javascript">
$(function(){
	var hash = location.hash.slice(1);
	$("input[name='hash']").val(hash);
	$("#PverificationCode").click(function(){
		$("#PverificationImg").attr("src","${contextPath}/portal/captcha/generateCaptcha.do?num="+Math.random());
	});
})
//登录验证
function loginValidation(){
 	var code= $('input[name="PverificationCode"]')[0].value;
 	var validFlag = false;
 	if(!code){
 		$("#verificationCode").show();
 		$("#userCheck").hide();
 		$("#verificationCode").text("验证码不能为空");
 		return false;
 	}
    $.ajax({
      url: '${contextPath}/portal/captcha/verifyCaptcha.json?captcha='+code,
      type: 'get',
      async: false,    
      dataType: 'json',
      success: function(result){
      if(!result.data.isSuccess){
      	$("#verificationCode").show();
      	$("#userCheck").hide();
 		$("#verificationCode").text("验证码错误");
        validFlag=false;
        $("#PverificationImg").attr("src","${contextPath}/portal/captcha/generateCaptcha.do?num="+Math.random());
      }else{
      	$("#userCheck").show();
      	$("#verificationCode").text("");
        validFlag=true;
        }
      }
    });
    if(!validFlag){
		return false;
    }
    $("#verificationCode").text("");
    $("#userCheck").show();
	var pwd = $("#login_password").val();
	$("#login_password").val($.md5(pwd));
}
</script>
</body>
</html>